Add independent incident scope for event types#355
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
apodacaduron
left a comment
There was a problem hiding this comment.
Working well, matches same values of bulletin after migration, setting new event types show correctly on incidents and it's searchable as needed
Summary
Event types now have an independent Incidents scope, separate from Bulletins. Previously the Incidents screen reused the
for_bulletinflag, so an event type assignable to Bulletins was automatically assignable to Incidents, with no way to scope a type to Incidents alone. This adds a third toggle alongside the existing Actors and Bulletins ones, mirroring the establishedfor_incidentpattern already used by Labels.How it works
Eventtype.for_incidentcolumn, serialized into_dict, accepted infrom_jsonand the validation model; the eventtypes API now acceptstyp=for_incident.for_bulletin: the event picker (incidents.html) and the search/filter sidebar (IncidentSearchBox.js), matching how the Actor and Bulletin search boxes use their own flags.enferno/data/eventtypes.csv): newfor_incidentcolumn, set equal tofor_bulletinper row so fresh installs match the migration backfill.Migration
c7d2e9f4a1b8adds the column and backfillsfor_incident = for_bulletinfor existing rows, so the Incidents event-type list is unchanged on day one. Admins can then curate it independently. No data is removed; existing incident events keep their types regardless of the flag.Tests
Eventtype CRUD test exercises the new field; factory and
create_eventtype_forhelper extended to support incident-scoped types. All eventtype lookup tests pass.